<?php

namespace App\Http\Controllers;

use App\Models\Department;
use App\Models\User;
use Illuminate\Http\Request;

class ConfigController extends Controller
{
    public function getConfig(Request $request)
    {
        $departments = Department::with('children_department')->select(['id','name', 'parent_id'])->first()->toArray();
        return ['department' => $departments , 'users' => User::all(['id','name'])];
    }
}


